-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: presign url using blob storage #82
feat: presign url using blob storage #82
Conversation
Signed-off-by: bestmike007 <i@bestmike007.com>
Signed-off-by: bestmike007 <i@bestmike007.com>
internal/storage/blobstorage/gcs/blob_storage_integration_test.go
Outdated
Show resolved
Hide resolved
Co-authored-by: Jie Zhang <zhangjie@gmail.com>
Signed-off-by: bestmike007 <i@bestmike007.com>
Signed-off-by: bestmike007 <i@bestmike007.com>
Signed-off-by: bestmike007 <i@bestmike007.com>
Signed-off-by: bestmike007 <i@bestmike007.com>
a092a8d
to
b3faa94
Compare
Signed-off-by: bestmike007 <i@bestmike007.com>
internal/server/handler.go
Outdated
@@ -715,7 +715,8 @@ func (s *Server) newBlockFile(block *api.BlockMetadata) (*api.BlockFile, error) | |||
compression := storage_utils.GetCompressionType(key) | |||
fileUrl, err := s.blobStorage.PreSign(context.Background(), key) | |||
if err != nil { | |||
return nil, err | |||
s.logger.Error("block file s3 presign error", zap.String("key", key), zap.Error(err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a logging interceptor taking care of the logs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
internal/server/handler.go
Outdated
@@ -715,7 +715,8 @@ func (s *Server) newBlockFile(block *api.BlockMetadata) (*api.BlockFile, error) | |||
compression := storage_utils.GetCompressionType(key) | |||
fileUrl, err := s.blobStorage.PreSign(context.Background(), key) | |||
if err != nil { | |||
return nil, err | |||
s.logger.Error("block file s3 presign error", zap.String("key", key), zap.Error(err)) | |||
return nil, status.Errorf(codes.Internal, "internal block file url generation error: %+v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all errors are by default mapped to internal by the error interceptor. no need to repeat it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -25,6 +25,9 @@ aws: | |||
region: us-east-1 | |||
storage: | |||
data_compression: GZIP | |||
gcp: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to change GcpConfig
to a pointer so it becomes optional. Then I guess we don't need to add this section to the default template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's already a pointer, so optional. However, since we marked the presigned_url_expiration
required, we need a default value for it because gcp project is always required for firestore.
Signed-off-by: bestmike007 <i@bestmike007.com>
What changed? Why?
PreSigned url needs to be moved into specific blob storage type.
How did you test the change?
GitHub Actions